package com.ocm.tourism.core.jdbc.rowmapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.ocm.tourism.core.domain.FileInfo;
import com.ocm.tourism.core.domain.FoodStall;

public class FoodStallRowMapper implements RowMapper<FoodStall>{

   public FoodStall mapRow(ResultSet resultSet, int rownumber) throws SQLException {
      FoodStall culinaryCulture = new FoodStall();
      culinaryCulture.setId(resultSet.getLong("bus_id"));
      culinaryCulture.setAddress(resultSet.getString("bus_address"));
      culinaryCulture.setDescription(resultSet.getString("bus_desc"));
      culinaryCulture.setFax(resultSet.getString("bus_fax"));
      culinaryCulture.setMobilephone(resultSet.getString("bus_mobile"));
      culinaryCulture.setHomephone(resultSet.getString("bus_homephone"));
      culinaryCulture.setName(resultSet.getString("bus_name"));

      FileInfo avatar = new FileInfo();
      avatar.setId(resultSet.getLong("fi_id"));
      avatar.setAbsolutePath(resultSet.getString("fi_absolutepath"));
      avatar.setExtension(resultSet.getString("fi_extension"));
      avatar.setFileDetail(resultSet.getString("fi_fileDetail"));
      avatar.setMimetypes(resultSet.getString("fi_minetypes"));
      avatar.setName(resultSet.getString("fi_name"));

      culinaryCulture.setAvatar(avatar);
      return culinaryCulture;
   }
}
